#include <thread>
#include <iostream>

int main()
{
    std::thread thread([]() {
        while (true) {
            std::cout << 1 << std::endl;
            std::this_thread::sleep_for(std::chrono::seconds(1));
        }
    });
    thread.detach();
    std::this_thread::sleep_for(std::chrono::seconds(3));
    std::cout << 2 << std::endl;
    return 0;
}
